/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/*
 * Teste.java
 *
 * Created on 02/08/2011, 19:41:28
 */
package savet.gui.tabelas.group;

import savet.gui.util.PeriodoUtil;
import savet.gui.tabelas.NewDefaultTableModel;
import java.util.ArrayList;
import java.util.GregorianCalendar;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import javax.swing.UIManager;
import org.apache.commons.collections.map.LinkedMap;

/**
 *
 * @author Rafael
 */
public class Teste extends javax.swing.JFrame {

    /** Creates new form Teste */
    public Teste() {
        try {
            UIManager.setLookAndFeel("com.sun.java.swing.plaf.windows.WindowsLookAndFeel");
        } catch (Exception ex) {
        }
        initComponents();

        LinkedMap meses = new LinkedMap(PeriodoUtil.getMapMeses(new GregorianCalendar(2010, 3, 1).getTime(),
                new GregorianCalendar(2011, 8, 1).getTime()));
        LinkedMap anos = new LinkedMap(PeriodoUtil.getMapAnos(new GregorianCalendar(2010, 3, 1).getTime(),
                new GregorianCalendar(2011, 8, 1).getTime()));
       
        
      

        NewDefaultTableModel defaultTableModel = new NewDefaultTableModel(meses.values().toArray());
        jTableGroupableHeader1.setModel(defaultTableModel);

       

    }

    /** This method is called from within the constructor to
     * initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is
     * always regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        jScrollPane1 = new javax.swing.JScrollPane();
        jTableGroupableHeader1 = new savet.gui.tabelas.group.JTableGroupableHeader();

        setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);

        jTableGroupableHeader1.setModel(new javax.swing.table.DefaultTableModel());
        jTableGroupableHeader1.setAutoResizeMode(javax.swing.JTable.AUTO_RESIZE_OFF);
        jScrollPane1.setViewportView(jTableGroupableHeader1);

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 557, Short.MAX_VALUE)
                .addContainerGap())
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
                .addContainerGap(14, Short.MAX_VALUE)
                .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 335, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap())
        );

        pack();
    }// </editor-fold>//GEN-END:initComponents

    /**
     * @param args the command line arguments
     */
    public static void main(String args[]) {
        java.awt.EventQueue.invokeLater(new Runnable() {

            public void run() {
                new Teste().setVisible(true);
            }
        });
    }
    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JScrollPane jScrollPane1;
    private savet.gui.tabelas.group.JTableGroupableHeader jTableGroupableHeader1;
    // End of variables declaration//GEN-END:variables
}
